<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="utf-8">
	<title>USDZExporter - Three.js Docs</title>
	<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
	<script src="../scripts/highlight.min.js"></script>
	<link type="text/css" rel="stylesheet" href="../styles/highlight-three.css">
	<link type="text/css" rel="stylesheet" href="../styles/page.css">
</head>
<body>
	<h1 translate="no">USDZExporter</h1>
		<section>
			<header>
				<div class="class-description"><p>An exporter for USDZ.</p></div>
				<h2>Code Example</h2>
				<div translate="no"><pre><code class="language-js">const exporter = new USDZExporter();
const arraybuffer = await exporter.parseAsync( scene );
</code></pre></div>
			</header>
			<article>
				<h2 class="subsection-title">Import</h2>
				<p><span translate="no">USDZExporter</span> is an addon, and must be imported explicitly, see <a href="https://threejs.org/manual/#en/installation" target="_blank" rel="noopener">Installation#Addons</a>.</p>
				<pre><code class="language-js">import { USDZExporter } from 'three/addons/exporters/USDZExporter.js';</code></pre>
				<div class="container-overview">
					<h2>Constructor</h2>
					<h3 class="name name-method" id="USDZExporter" translate="no">new <a href="#USDZExporter">USDZExporter</a><span class="signature">()</span> </h3>
					<div class="method">
						<div class="description">
							<p>Constructs a new USDZ exporter.</p>
						</div>
					</div>
				</div>
				<h2 class="subsection-title">Properties</h2>
				<div class="member">
					<h3 class="name" id="textureUtils" translate="no">.<a href="#textureUtils">textureUtils</a><span class="type-signature"> : <a href="WebGLTextureUtils.html">WebGLTextureUtils</a> | <a href="WebGPUTextureUtils.html">WebGPUTextureUtils</a></span> </h3>
					<div class="description">
						<p>A reference to a texture utils module.</p>
						<p>Default is <code>null</code>.</p>
					</div>
				</div>
				<h2 class="subsection-title">Methods</h2>
					<h3 class="name name-method" id="parse" translate="no">.<a href="#parse">parse</a><span class="signature">( scene : <span class="param-type"><a href="Object3D.html">Object3D</a></span>, onDone : <span class="param-type"><a href="USDZExporter.html#~OnDone">USDZExporter~OnDone</a></span>, onError : <span class="param-type"><a href="USDZExporter.html#~OnError">USDZExporter~OnError</a></span>, options : <span class="param-type"><a href="USDZExporter.html#~Options">USDZExporter~Options</a></span> )</span> </h3>
					<div class="method">
						<div class="description">
							<p>Parse the given 3D object and generates the USDZ output.</p>
						</div>
						<table class="params">
							<tbody>
								<tr>
									<td class="name">
										<strong>scene</strong>
									</td>
									<td class="description last">
										<p>The 3D object to export.</p>
									</td>
								</tr>
								<tr>
									<td class="name">
										<strong>onDone</strong>
									</td>
									<td class="description last">
										<p>A callback function that is executed when the export has finished.</p>
									</td>
								</tr>
								<tr>
									<td class="name">
										<strong>onError</strong>
									</td>
									<td class="description last">
										<p>A callback function that is executed when an error happens.</p>
									</td>
								</tr>
								<tr>
									<td class="name">
										<strong>options</strong>
									</td>
									<td class="description last">
										<p>The export options.</p>
									</td>
								</tr>
							</tbody>
						</table>
					</div>
					<h3 class="name name-method" id="parseAsync" translate="no">.<a href="#parseAsync">parseAsync</a><span class="signature">( scene : <span class="param-type"><a href="Object3D.html">Object3D</a></span>, options : <span class="param-type"><a href="USDZExporter.html#~Options">USDZExporter~Options</a></span> )</span><span class="type-signature"> : Promise.&lt;ArrayBuffer></span> <span class="type-signature">(async) </span></h3>
					<div class="method">
						<div class="description">
							<p>Async version of <a href="USDZExporter.html#parse">USDZExporter#parse</a>.</p>
						</div>
						<table class="params">
							<tbody>
								<tr>
									<td class="name">
										<strong>scene</strong>
									</td>
									<td class="description last">
										<p>The 3D object to export.</p>
									</td>
								</tr>
								<tr>
									<td class="name">
										<strong>options</strong>
									</td>
									<td class="description last">
										<p>The export options.</p>
									</td>
								</tr>
							</tbody>
						</table>
						<dl class="details">
							<dt class="tag-returns"><strong>Returns:</strong> A Promise that resolved with the exported USDZ data.</dt>
						</dl>
					</div>
					<h3 class="name name-method" id="setTextureUtils" translate="no">.<a href="#setTextureUtils">setTextureUtils</a><span class="signature">( utils : <span class="param-type"><a href="WebGLTextureUtils.html">WebGLTextureUtils</a> | <a href="WebGPUTextureUtils.html">WebGPUTextureUtils</a></span> )</span> </h3>
					<div class="method">
						<div class="description">
							<p>Sets the texture utils for this exporter. Only relevant when compressed textures have to be exported.</p>
<p>Depending on whether you use <a href="WebGLRenderer.html">WebGLRenderer</a> or <a href="WebGPURenderer.html">WebGPURenderer</a>, you must inject the
corresponding texture utils <a href="WebGLTextureUtils.html">WebGLTextureUtils</a> or <a href="WebGPUTextureUtils.html">WebGPUTextureUtils</a>.</p>
						</div>
						<table class="params">
							<tbody>
								<tr>
									<td class="name">
										<strong>utils</strong>
									</td>
									<td class="description last">
										<p>The texture utils.</p>
									</td>
								</tr>
							</tbody>
						</table>
					</div>
				<h2 class="subsection-title">Type Definitions</h2>
					<h3 class="name name-method" id="~OnDone" translate="no">.<a href="#~OnDone">OnDone</a><span class="signature">( result : <span class="param-type">ArrayBuffer</span> )</span> </h3>
					<div class="method">
						<div class="description">
							<p>onDone callback of <code>USDZExporter</code>.</p>
						</div>
						<table class="params">
							<tbody>
								<tr>
									<td class="name">
										<strong>result</strong>
									</td>
									<td class="description last">
										<p>The generated USDZ.</p>
									</td>
								</tr>
							</tbody>
						</table>
					</div>
					<h3 class="name name-method" id="~OnError" translate="no">.<a href="#~OnError">OnError</a><span class="signature">( error : <span class="param-type">Error</span> )</span> </h3>
					<div class="method">
						<div class="description">
							<p>onError callback of <code>USDZExporter</code>.</p>
						</div>
						<table class="params">
							<tbody>
								<tr>
									<td class="name">
										<strong>error</strong>
									</td>
									<td class="description last">
										<p>The error object.</p>
									</td>
								</tr>
							</tbody>
						</table>
					</div>
				<div class="member">
					<h3 class="name" id="~Options" translate="no">.<a href="#~Options">Options</a> </h3>
					<div class="description">
						<p>Export options of <code>USDZExporter</code>.</p>
					</div>
<table class="props">
	<tbody>
		<tr>
				<td class="name">
					<strong>maxTextureSize</strong>
						<br>
<span class="param-type">number</span>
				</td>
			<td class="description last">
				<p>The maximum texture size that is going to be exported.</p>
						<p>Default is <code>1024</code>.</p>
			</td>
		</tr>
		<tr>
				<td class="name">
					<strong>includeAnchoringProperties</strong>
						<br>
<span class="param-type">boolean</span>
				</td>
			<td class="description last">
				<p>Whether to include anchoring properties or not.</p>
						<p>Default is <code>true</code>.</p>
			</td>
		</tr>
		<tr>
				<td class="name">
					<strong>onlyVisible</strong>
						<br>
<span class="param-type">boolean</span>
				</td>
			<td class="description last">
				<p>Export only visible 3D objects.</p>
						<p>Default is <code>true</code>.</p>
			</td>
		</tr>
		<tr>
				<td class="name">
					<strong>ar</strong>
						<br>
<span class="param-type">Object</span>
				</td>
			<td class="description last">
				<p>If <code>includeAnchoringProperties</code> is set to <code>true</code>, the anchoring type and alignment
can be configured via <code>ar.anchoring.type</code> and <code>ar.planeAnchoring.alignment</code>.</p>
			</td>
		</tr>
		<tr>
				<td class="name">
					<strong>quickLookCompatible</strong>
						<br>
<span class="param-type">boolean</span>
				</td>
			<td class="description last">
				<p>Whether to make the exported USDZ compatible to QuickLook
which means the asset is modified to accommodate the bugs FB10036297 and FB11442287 (Apple Feedback).</p>
						<p>Default is <code>false</code>.</p>
			</td>
		</tr>
	</tbody>
</table>
				</div>
				<h2 class="subsection-title">Source</h2>
				<p>
					<a href="https://github.com/mrdoob/three.js/blob/master/examples/jsm/exporters/USDZExporter.js" translate="no" target="_blank" rel="noopener">examples/jsm/exporters/USDZExporter.js</a>
				</p>
			</article>
		</section>
<script src="../scripts/linenumber.js"></script>
<script src="../scripts/page.js"></script>
</body>
</html>